<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>一个简单的例子</title>
    <style media="screen">
        div{
            width: 50px;
            height: 100px;
            background-color: green;
        }

        @-webkit-keyframes mybox{
            0%{width: 50px;height: 100px;}
            50%{width: 200px;height: 100px;}
            100%{width: 200px;height: 200px;}
        }
        div:hover{
            -webkit-animation-name:mybox;
            -webkit-animation-duration:2s;
            -webkit-animation-iteration-count:infinite;/*动画次数*/
            -webkit-animation-direction:alternate;/*动画播放方向*/
        }

    </style>
</head>
<body>
    <div></div>
</body>
</html>
